package com.wxapp.sale.service.controller.client;

import com.wxapp.common.constant.base.IBaseController;
import com.wxapp.common.constant.pojo.vm.ResultVm;
import com.wxapp.sale.api.pojo.vm.goodsSpec.PGoodSpecDetailBaseVm;
import com.wxapp.sale.api.pojo.vm.goodsSpec.PGoodsSpecVm;
import com.wxapp.sale.service.service.GoodsSpecService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author lgl
 * @Description 商品分类管理表
 * @Datetime 2023/4/23 15:57
 * @Modified By
 */
@RestController
@RequestMapping("client/goods/spec")
@Tag(name = "商品分类管理")
@RequiredArgsConstructor
public class GoodsSpecClientController extends IBaseController {
    private final GoodsSpecService goodsSpecService;

    @GetMapping("getListByTypeId/{typeId}")
    @Operation(summary ="获取分类list")
    public ResultVm<List<PGoodsSpecVm>> getListByTypeId(@PathVariable String typeId) {
        return goodsSpecService.getListByTypeId(typeId);
    }

    @GetMapping("getSpecDetailByPid/{specId}")
    @Operation(summary ="获取分类详情")
    public ResultVm<List<PGoodSpecDetailBaseVm>> getSpecDetailByPid(@PathVariable String specId) {
        return goodsSpecService.getSpecDetailByPid(specId);
    }
}
